<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P137 【例6-4】demo04.html</title>
</head>

<body>
    <input type="button" value="载入新文档" onclick="newPage()">
    <input type="button" value="刷新页面" onclick="freshPage()">
    <p id="time"></p>
    <script>
        var ds = new Date(), d = ds.getDate();
        var t = ds.toLocaleTimeString();
        document.getElementById('time').innerHTML = t;
        function newPage() {
            window.location, assign('http://www.example.com')
        }
        function freshPage() {
            location.reload(true);
        }
    </script>
    <a href="../首页/page06.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>